<template>
    <div>
        <TodoComponent />
    </div>

</template>

<script setup>
import {ref,onMounted} from 'vue'
import TodoComponent from '../components/TodoComponent.vue'

import useUserInfoStore from "@/stores/user"; //引入仓库
import { storeToRefs } from "pinia"; //引入pinia转换
const userInfoStore = useUserInfoStore()
const { username} = storeToRefs(userInfoStore); 
import { useRouter } from "vue-router";
onMounted(() => {
    if(username.value==null || username.value==''){
        const router = useRouter();
        router.push({
            path: "/login"
        });
    }
})
</script>
